<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Vue</title>
    <link rel="stylesheet" href="/css/common.css">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(item, idx) of arr" v-bind:key="idx">{{item}}</li>
    </ul>
</div>
<button onclick="replaceFirstOne()">设置第一个</button>
<script type="text/javascript">
    const outData = {
        arr: ['a', 'b', 'c']
    }
    const app = new Vue({
        el: '#app',
        data: outData
    })
    function replaceFirstOne() {
        // app.arr[0] = 'abc'  // 页面不会发生改变
        Vue.set(app.arr, 0, 'A')
    }
</script>
</body>
</html>
